home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3dm / audio / alCheckEvent.z / alCheckEvent
Encoding:
Text File  |  1998-10-20  |  6.4 KB  |  133 lines

  1.  
  2.  
  3.  
  4. aaaallllCCCChhhheeeecccckkkkEEEEvvvveeeennnntttt((((3333ddddmmmm))))                                            aaaallllCCCChhhheeeecccckkkkEEEEvvvveeeennnntttt((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      alCheckEvent - Looks for an event in the event queue and retrieves it.
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////aaaauuuuddddiiiioooo....hhhh>>>>
  13.  
  14.      iiiinnnntttt aaaallllCCCChhhheeeecccckkkkEEEEvvvveeeennnntttt((((AAAALLLLeeeevvvveeeennnnttttQQQQuuuueeeeuuuueeee eeeevvvveeeennnnttttqqqq,,,,iiiinnnntttt ssssrrrrcccc,,,,iiiinnnntttt ppppaaaarrrraaaammmm,,,,AAAALLLLeeeevvvveeeennnntttt eeeevvvveeeennnntttt))))
  15.  
  16. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRR
  17.      _e_v_e_n_t_q   expects an AAAALLLLeeeevvvveeeennnnttttQQQQuuuueeeeuuuueeee structure from which you want to
  18.               retrieve audio events.
  19.  
  20.      _s_r_c      expects an int with the value of the resource that generated or
  21.               posted the audio event.
  22.  
  23.      _p_a_r_a_m    expects an int with the value of the parameter for the audio
  24.               event.
  25.  
  26.      _e_v_e_n_t    expects an AAAALLLLeeeevvvveeeennnntttt structure previously initialized by
  27.               aaaallllNNNNeeeewwwwEEEEvvvveeeennnntttt((((3333ddddmmmm)))).
  28.  
  29.  
  30. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  31.      aaaallllCCCChhhheeeecccckkkkEEEEvvvveeeennnntttt((((3333ddddmmmm)))) retrieves the next AAAALLLLeeeevvvveeeennnntttt struct in _e_v_e_n_t_q that
  32.      matches its fields with _p_a_r_a_m and _s_r_c and places it on _e_v_e_n_t.  This call
  33.      will not block if the event is not found, or the event queue is empty.
  34.      Note that _s_r_c refers to the resource that generated or posted the event,
  35.      please refer to aaaallllSSSSeeeelllleeeeccccttttEEEEvvvveeeennnnttttssss((((3333ddddmmmm)))) and aaaallllPPPPaaaarrrraaaammmmssss((((3333ddddmmmm)))) for more
  36.      information.
  37.  
  38.      To process the event, use the following calls: aaaallllGGGGeeeettttEEEEvvvveeeennnnttttPPPPaaaarrrraaaammmm((((3333ddddmmmm)))),
  39.      aaaallllGGGGeeeettttEEEEvvvveeeennnnttttUUUUSSSSTTTT((((3333ddddmmmm)))), aaaallllGGGGeeeettttEEEEvvvveeeennnnttttVVVVaaaalllluuuueeee((((3333ddddmmmm)))), aaaallllGGGGeeeettttEEEEvvvveeeennnnttttDDDDaaaattttaaaa((((3333ddddmmmm)))),
  40.      aaaallllGGGGeeeettttEEEEvvvveeeennnnttttRRRReeeessssoooouuuurrrrcccceeee((((3333ddddmmmm)))),  and aaaallllGGGGeeeettttEEEEvvvveeeennnnttttSSSSrrrrccccRRRReeeessssoooouuuurrrrcccceeee((((3333ddddmmmm)))).
  41.  
  42. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  43.      The following examples tries to retrieve an event from an event queue
  44.      through aaaallllCCCChhhheeeecccckkkkEEEEvvvveeeennnntttt((((3333ddddmmmm)))).  The event should have an AL_GAIN parameter
  45.      and the its resource should be the AL_DEFAULT_INPUT.
  46.  
  47.      int     param;
  48.      ALevent event;
  49.      /*
  50.       * Initialize an ALevent structure.
  51.       */
  52.  
  53.      event = alNewEvent();
  54.      if(event == NULL) {
  55.        fprintf(stderr,"Event allocation failed: %s",
  56.        alGetErrorString(oserror()));
  57.        exit(-1);
  58.      }
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. aaaallllCCCChhhheeeecccckkkkEEEEvvvveeeennnntttt((((3333ddddmmmm))))                                            aaaallllCCCChhhheeeecccckkkkEEEEvvvveeeennnntttt((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74.      /*
  75.       * Check for the event
  76.       */
  77.      param = AL_GAIN;
  78.      resource = AL_DEFAULT_INPUT;
  79.  
  80.      status = alCheckEvent(eventq,param,resource,event);
  81.      if(status == -1) {
  82.        fprintf(stderr,"Event was not found: %s",
  83.        alGetErrorString(oserror()));
  84.        exit(-1);
  85.      }
  86.  
  87.  
  88. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  89.      Upon successful completion, aaaallllCCCChhhheeeecccckkkkEEEEvvvveeeennnntttt returns 0.
  90.  
  91.      Otherwise, aaaallllCCCChhhheeeecccckkkkEEEEvvvveeeennnntttt returns -1 and sets an error number which can be
  92.      retrieved with oooosssseeeerrrrrrrroooorrrr((((3333CCCC)))).
  93.  
  94.      aaaallllCCCChhhheeeecccckkkkEEEEvvvveeeennnntttt can fail for the following reason:
  95.  
  96.      AAAALLLL____BBBBAAAADDDD____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEEVVVVEEEENNNNTTTTQQQQ    _e_v_e_n_t_q is either invalid or null.
  97.  
  98.      AAAALLLL____BBBBAAAADDDD____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEEVVVVEEEENNNNTTTT     _e_v_e_n_t is either invalid or null.
  99.  
  100.      AAAALLLL____BBBBAAAADDDD____EEEEVVVVEEEENNNNTTTT____NNNNOOOOTTTT____FFFFOOOOUUUUNNNNDDDD   An event match was not found in _e_v_e_n_t_q.
  101.  
  102. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  103.      alOpenEventQueue(3dm), alSelectEvents(2), alGetEventParam(3dm),
  104.      alGetEventUST(3dm), alGetEventValue(3dm), alGetEventData(3dm),
  105.      alGetEventResource(3dm), alGetEventSrcResource(3dm), alParams(3dm),
  106.      oserror(3C)
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.